// https://iai.sh.cn/problem/246
#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 9;
int main() {
  int n;
  cin >> n;
  int s = 1;
  int t = 1;
  for (int i = 2; i <= n; i++) {
    int k = s;
    s = (s + t) % M;
    t = k;
  }
  cout << (s + t) % M;
  return 0;
}
